package com.xiaoyy.app.api.gateway.controller;

import cn.hutool.core.convert.Convert;
import com.github.pagehelper.PageInfo;
import com.xiaoyy.app.api.common.vo.person.*;
import com.xiaoyy.app.api.core.integration.PersonIntegration;
import com.xiaoyy.app.api.gateway.req.person.*;
import com.xiaoyy.core.common.vo.AppResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 就业创业码人员管理
 *
 * @author chenzh
 * @date 2020-06-23
 */
@RestController
@RequestMapping(value = "/app/api/person")
@Api(tags = "人员接口管理")
public class PersonController {
    @Autowired
    PersonIntegration personIntegration;
    /**
     * 获取个人名片 通过个人码
     * */
    @PostMapping(value = "/query/getBusinessCard/societyCode", produces = "application/json;charset=UTF-8")
    @ApiOperation(value = "通过个人码获取个人名片", notes = "根据个人码获取个人名片")
    public AppResponse<BusinessCardVO> getBusinessCardBySocietyCode(@RequestBody @Validated SocietyCodeReq req) {
        PersonQueryVO vo= Convert.convert(PersonQueryVO.class,req);
        return AppResponse.successData(personIntegration.getBusinessCardBySocietyCode(vo));
    }
    /**
     * 获取个人名片
     * */
    @PostMapping(value = "/query/getBusinessCard", produces = "application/json;charset=UTF-8")
    @ApiOperation(value = "通过身份证获取个人名片", notes = "根据身份证获取个人名片")
    public AppResponse<BusinessCardVO> getBusinessCardByIdcard(@RequestBody @Validated PersonBaseQueryReq req) {
        PersonQueryVO vo= Convert.convert(PersonQueryVO.class,req);
        return AppResponse.successData(personIntegration.getBusinessCardByIdcard(vo));
    }
    /**
     * 获取人员基础信息
     * */
    @PostMapping(value = "/query/getPersonInfo", produces = "application/json;charset=UTF-8")
    @ApiOperation(value = "获取人员基础信息", notes = "获取人员基础信息")
    public AppResponse<PersonInfoVO> getPersonInfo(@RequestBody @Validated PersonBaseQueryReq req) {
        PersonQueryVO vo= Convert.convert(PersonQueryVO.class,req);
        return AppResponse.successData(personIntegration.getPersonInfo(vo));
    }
    /**
     * 获取人员当前参保信息
     * */
    @PostMapping(value = "/query/getPersonInsured", produces = "application/json;charset=UTF-8")
    @ApiOperation(value = "获取人员当前参保信息", notes = "获取人员当前参保信息")
    public AppResponse<List<PersonInsuredVO>> getPersonInsured(@RequestBody @Validated PersonInsuredQueryReq req) {
        return AppResponse.success();
    }
    /**
     * 获取人员缴费明细信息
     * */
    @PostMapping(value = "/query/getPaymentDetails", produces = "application/json;charset=UTF-8")
    @ApiOperation(value = "获取人员缴费明细信息", notes = "获取人员缴费明细信息,分页参数为空则查询全部数据")
    public AppResponse<PageInfo<PersonInsuredVO>> getPaymentDetails(@RequestBody @Validated PersonPaymentDetailsReq req) {
        return AppResponse.success();
    }
    /**
     * 根据缴费明细获取人员工作经历
     * */
    @PostMapping(value = "/query/getSocietyWorkExperience", produces = "application/json;charset=UTF-8")
    @ApiOperation(value = "获取参保缴费情况工作经历", notes = "获取参保缴费情况工作经历")
    public AppResponse<List<PersonInsuredVO>> getSocietyWorkExperience(@RequestBody @Validated PersonPaymentDetailsReq req) {
        return AppResponse.success();
    }
    /**
     * 获取人员待遇信息
     * */
    @PostMapping(value = "/query/getPersonTreatment", produces = "application/json;charset=UTF-8")
    @ApiOperation(value = "获取人员当前待遇信息", notes = "获取人员当前待遇信息")
    public AppResponse<List<PersonTreatmentVO>> getPersonTreatment(@RequestBody @Validated PersonTreatmentQueryReq req) {
        return AppResponse.success();
    }
    /**
     * 获取人员待遇明细信息
     * */
    @PostMapping(value = "/query/getPersonTreatmentDetails", produces = "application/json;charset=UTF-8")
    @ApiOperation(value = "获取人员当前待遇明细信息", notes = "获取人员待遇发放明细信息,分页参数为空则查询所有")
    public AppResponse<PageInfo<PersonTreatmentDetailsVO>> getPersonTreatmentDetails(@RequestBody @Validated PersonTreatmentDetailsReq req) {
        return AppResponse.success();
    }
    /**
     * 获取人员待遇发放信息
     * */

    /**
     * 获取人员绑定银行账号信息
     * */

    /**
     * 获取信义金信息
     * */

    /**
     * 人员新增
     * */

    /**
     * 人员修改
     * */

    /**
     * 人员删除
     * */

    /**
     * 人员批量删除
     * */
}
